package org.example.modules.user.controller;

import com.alibaba.fastjson2.JSONObject;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.example.modules.user.common.Commsult;
import org.example.modules.user.entry.UserFeedBack;
import org.example.modules.user.service.UserFeedBackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Description UserFeedBack
 * @Author xiaotian
 * @Date 2025-04-25
 */
@RestController
@RequestMapping("/wxApi/feedback")
@Slf4j
public class UserFeedBackController {

    @Autowired
    private UserFeedBackService userFeedBackService;


    @PostMapping("/save")
    public Commsult addFeedBack(@RequestBody JSONObject data){
        userFeedBackService.addFeedBack(data);
        return Commsult.success(null);
    }
    @GetMapping("/list")
    public Commsult<List<UserFeedBack>> getList(){
        return userFeedBackService.getList();
    }
}
